Skip to content

makefile: update CPPFLAGS & CFLAGS#294

Closed
clan wants to merge 1 commit intoNVIDIA:mainfrom
clan:flags
Closed

makefile: update CPPFLAGS & CFLAGS#294
clan wants to merge 1 commit intoNVIDIA:mainfrom
clan:flags

Conversation

@clan
Copy link
Copy Markdown

@clan clan commented Jan 18, 2025

  1. _FORTIFY_SOURCE is defined built-in by compiler, so undefine the define to slience warnings like:

: warning: "_FORTIFY_SOURCE" redefined
: note: this is the location of the previous definition

  1. -Wno-unknown-warning-option & -Wno-gnu-alignof-expression are available for clang only, but "-fplan9-extensions" is used which is gcc only! So remove these two warning options to avoid:

cc1: note: unrecognized command-line option ‘-Wno-gnu-alignof-expression’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics

@lahwaacz
Copy link
Copy Markdown

Where do you get warning: "_FORTIFY_SOURCE" redefined ? The documentation for GCC at least says nothing about the need to undefine it: https://www.gnu.org/software/libc/manual/html_node/Source-Fortification.html

@clan
Copy link
Copy Markdown
Author

clan commented Jan 19, 2025

Where do you get warning: "_FORTIFY_SOURCE" redefined ? The documentation for GCC at least says nothing about the need to undefine it: https://www.gnu.org/software/libc/manual/html_node/Source-Fortification.html

see: SELinuxProject/selinux@4f96b32
and discussion here: https://patchwork.kernel.org/project/selinux/patch/1544736761-7920-1-git-send-email-william.c.roberts@intel.com/

I encoutered this warning when compilng in Gentoo Hardened profile.

1. _FORTIFY_SOURCE is defined built-in by certian build of gcc (such as Gentoo
   in Hardened profile), so undefine the define to slience warnings like:
    <command-line>: warning: "_FORTIFY_SOURCE" redefined
    <built-in>: note: this is the location of the previous definition
2. -Wno-unknown-warning-option & -Wno-gnu-alignof-expression are
   available for clang only, but "-fplan9-extensions" is used which is
   gcc only! So remove these two warning options to avoid:
     cc1: note: unrecognized command-line option ‘-Wno-gnu-alignof-expression’ may have been intended to silence earlier diagnostics
     cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics

Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 5, 2025

This PR is stale because it has been open 90 days with no activity. This PR will be closed in 30 days unless new comments are made or the stale label is removed. To skip these checks, apply the "lifecycle/frozen" label.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 5, 2025
@clan
Copy link
Copy Markdown
Author

clan commented Dec 26, 2025

ping

@myeolenv myeolenv added feature issue/PR that proposes a new feature or functionality and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 31, 2026
@cdesiniotis
Copy link
Copy Markdown
Contributor

Hi @clan thanks for the contribution. I am not seeing the warnings regarding _FORTIFY_SOURCE in our build logs. And while some of the warnings we are ignoring may be specific to clang, I am inclined to not remove them as someone out there may be building this project with clang (as 10ec99e seems to suggest building with clang was supported at one point in time).

I am closing this PR as not planned.

@cdesiniotis cdesiniotis closed this Apr 8, 2026
@clan
Copy link
Copy Markdown
Author

clan commented Apr 8, 2026

but for the _FORTIFY_SOURCE part, undefine it right before -D_FORTIFY_SOURCE=2 is harmless I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature issue/PR that proposes a new feature or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants